# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=sdn-toolkit
pkgver=1.21
pkgrel=3
groups=('blackarch' 'blackarch-networking' 'blackarch-scanner' 'blackarch-recon')
pkgdesc='Discover, Identify, and Manipulate SDN-Based Networks '
arch=('any')
url='http://downloads.sourceforge.net/project/sdn-toolkit'
license=('GPL3')
depends=('python2' 'python2-simplejson' 'python2-dpkt')
makedepends=('dos2unix')
source=("http://downloads.sourceforge.net/project/$pkgname/${pkgname}_v${pkgver}_openflow.tar")
sha512sums=('9944204c9a89eac9ed98fdd69d53249c29cd30a01c2b1eb88af7d4b4c3175a0138cd84527127a3b3f71e7d47d0ef165216ca9ee7fac95c95dbc8ac381e3ca58d')

prepare() {
  sed -i 's|/usr/bin/env python|/usr/bin/env python2|' *.py

  dos2unix *.py
}

package() {
  for i in *.py ; do
    install -Dm 755 $i "$pkgdir/usr/bin/"`echo $i | sed 's/.py//'`
  done

  install -Dm 644 "ReleaseNotes for v$pkgver.txt" \
    "$pkgdir/usr/share/doc/$pkgname/ReleaseNotes for v$pkgver.txt"
}

